@extends('home.userinfo.user_layout')
@section('title',$title)
@section('content')
	<div id="content" style="margin:0 auto;background:#F5F5F5;">
			<div id="sub">
<div id="menu" style="width: 100px;margin-left:180px;">
	<dl class="fore1">		
	<dt id="_MYJD_setting">设置</dt>		
	<dd class="fore1_1 curr" id="_MYJD_info">			
	<a clstag="homepage|keycount|home2013|Homeyser" href="/user" target="_self">个人信息</a>		
	</dd>		
	<dd class="fore1_2" id="_MYJD_safe">			
	<a clstag="homepage|keycount|home2013|Homesafe" href="/changepass" target="_self">账号安全</a>		
	</dd>		
	<dd class="fore1_3" id="_MYJD_accbinde">			
	<a clstag="homepage|keycount|home2013|Homezhbd" href="#" target="_self">账号绑定</a>		
	</dd>		
	<dd class="fore1_4" id="_MYJD_grade">			
	<a clstag="homepage|keycount|home2013|Homegrade" href="/dingdan" target="_self">我的订单</a>		
	</dd>		
	<dd class="fore1_5" id="_MYJD_comments">			
	<a clstag="homepage|keycount|home2013|homeadd" href="/address" target="_self">收货地址</a>		
	</dd>
		

	</dl>
</div>
			</div>
			
    		<div id="main" style="width:1050px;">
                <div class="mod-main" style="margin-left:180px;">
                    <div class="mt">
                        <ul class="extra-l">
                            <li class="fore-1"><a class="curr" href="/user">基本信息</a></li>
                            <li class="fore-2"><a href="/upic">头像照片</a></li>
                            
                            
                        </ul>
                    </div>

                    <div class="mc">
                        <div class="user-set userset-lcol" style="margin-left:-120px;margin-top:-30px;">
                            <div class="form">
                                <div class="item">
                                    <span class="label">用户名：</span>
                                    <div class="fl">
                                        <div><strong>个性男孩886</strong></div>
                                    </div>
                                </div>
                           
                                <form action="/user/update" method="post">
                                    {{csrf_field()}}
                                    <input type="hidden" name="id" value="{{$data -> id}}">
                                <div class="item">
                                    <span class="label"><em>*</em>用户名：</span>
                                   <div class="fl">
                                        <div><strong>{{$user -> username}}</strong></div>
                                    </div>
                                </div>
                                <div class="item">
                                    <span class="label"><em>*</em>性别：</span>
                                    <div class="fl" clstag="homepage|keycount|home2013|infoGender">
                                        <input 
                                        @if($data -> sex  == 0)
                                            checked
                                        @endif
                                        type="radio" name="sex" class="jdradio" value="0"><label class="mr10">男</label>
                                        <input 
                                        @if($data -> sex  == 1)
                                            checked
                                        @endif
                                        type="radio" name="sex" class="jdradio" value="1"><label class="mr10">女</label>

                                    </div>
                                </div>
                            
								<div class="item">
								<span class="label">邮箱：</span>
								
								<div class="fl">
                                        <input clstag="homepage|keycount|home2013|infoname" type="email" class="itxt" maxlength="20" id="email" name="email" value="{{$data -> email}}">
                                        <div class="clr"></div><div class="prompt-06">
                                        <span id="pass1" style="display:none;">邮箱格式不正确</span> 
                                        <span id="pass2" style="display:none;">邮箱格式正确</span>
                                        </div>

                                </div>
								<div class="clr"></div>
							</div>
							<div class="item">
								<span class="label">手机号：</span>
								
								<div class="fl">
                                        <input clstag="homepage|keycount|home2013|infoname" type="text" class="itxt" maxlength="20" id="phone" name="phone" value="{{$data -> phone}}">
                                        <div class="clr"></div><div class="prompt-06">
                                        <span id="phone1" style="display:none;">手机格式不正确</span> 
                                        <span id="phone2" style="display:none;">手机格式正确</span>
                                        </div>
                                </div>
								<div class="clr"></div>
							</div>
						
							<div class="item">
								<span class="label">注册时间：</span>
                                <span class="label">{{date('Y-m-d H:i:s',$data -> atime)}}</span>
								

								<div class="clr"></div>
							</div>
							
							
                                <div class="item">
                                    <span class="label">&nbsp;</span>
                                    <div class="fl">
                                       
                                        <input type="submit" value="提交">
                                    </div>
                                </div>
                                </form>
                            </div>
                        </div>

                        <div id="user-info" style="float:right;position:relative;right:150px;bottom:350px;border:1px solid #ccc;width:300px;height:125px;background:#F9F9F9">
                            <div class="u-pic" style="float:left;margin-top:20px;margin-left:20px; ">
                                <img alt="" src="{{$data -> pic}}" style="z-index:1;width:104px;height:104px;margin-top:-20px;margin-left:-20px;" >
                                <div class="mask" style="background: url('/home/img/myjd-bg2.png') 0 0;
                                width: 104px;height:104px;position: absolute;
                                left: 0;
                                top: 0;
                                z-index:2"></div>
                                <div class="face-link-box"></div>
                                <!-- <a href="#" class="face-link">修改头像</a> -->
                            </div>
                            <div class="info-m" style="float:right;margin-right:80px;margin-top:20px;margin-right:40px;">
								<div><b>用户名:{{$data -> username}}</b></div>
                                
                                <div>会员类型：个人用户</div>
                            </div>
                        </div>

						<!-- <div class="fr ac" style="width:280px;position:absolute;bottom:320px;right:320px;">
							  注：修改手机和邮箱请到<a clstag="homepage|keycount|home2013|infopay" class="ml5 ftx05" href="#">账户安全</a>
						</div>  -->
                        <div class="clr"></div>


                    </div>
                </div>
            </div>
        </div>
<script type="text/javascript">
    // alert($);
    //手机号判断
    $("input[name='phone']").on('blur',function()
    {
        $.post('/user/phone',{'_token':'{{csrf_token()}}','phone':$("#phone").val()},function(data)
        {
            if(data == 2)
            {
                $("#phone1").css("display","block");
                $("input[name='phone']").on('focus',function(){
                     $("#phone1").css("display","none");
                });
            }else if(data == 1){
                $("#phone2").css("display","block");
                 $("input[name='phone']").on('focus',function(){
                     $("#phone2").css("display","none");
                });
            }
        });
    });

    //email判断
     $("input[name='email']").on('blur',function()
    {
        $.post('/user/email',{'_token':'{{csrf_token()}}','email':$("#email").val()},function(data)
        {
            if(data == 2)
            {
                $("#pass1").css("display","block");
                $("input[name='email']").on('focus',function(){
                     $("#pass1").css("display","none");
                });
            }else if(data == 1){
                $("#pass2").css("display","block");
                 $("input[name='email']").on('focus',function(){
                     $("#pass2").css("display","none");
                });
            }
        });
    });
</script>
@endsection